package jvm.c2_classloader;

//双亲委派主要是保证安全
//一个ClassLoader对象会有一个缓存来存储自己加载的类
//同一个ClassLoader对象只能加载一次某个类的字节码
public class T011_ClassReloading1 {
    public static void main(String[] args) throws Exception {
        T006_MSBClassLoader msbClassLoader = new T006_MSBClassLoader();
        Class clazz = msbClassLoader.loadClass("jvm.xff.Hello");

//        msbClassLoader = null;
        System.out.println(clazz.hashCode());

//        msbClassLoader = null;

        T006_MSBClassLoader msbClassLoader2 = new T006_MSBClassLoader();
        Class clazz1 = msbClassLoader2.loadClass("jvm.xff.Hello");
        System.out.println(clazz1.hashCode());

        System.out.println(clazz == clazz1);
    }
}
